<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/vue.js"></script>
    <script src="/js/axios-0.18.0.js"></script>
    <!-- 引入elmUI   -->
    <script src="/element-ui/lib/index.js"></script>
</head>
<body>

<div id="div">
    <el-table
            :data="tableData"
            style="width: 100%">

        <el-table-column
                prop="id"
                label="学号"
                width="180">
        </el-table-column>
        <el-table-column
                prop="username"
                label="用户名"
                width="180">
        </el-table-column>
        <el-table-column
                prop="password"
                label="密码">
        </el-table-column>
        <el-table-column
                prop="sex"
                label="性别">
        </el-table-column>
    </el-table>
</div>
<script>
    new Vue({
        el:"#div",
        data:{
            tableData:[]
        },
        methods:{
            getList(){
                axios.get("/users").then(resp => {
                    console.log(resp.data)
                    this.tableData = resp.data
                    console.log("--------------------")
                    console.log(this.tableData)
                    console.log("--------------------")
                })
            }
        },
        created(){
            this.getList()
        }
    })
</script>
</body>
</html>